package com.astronomy.spit.controller;

import com.astronomy.entity.Result;
import com.astronomy.entity.StatusCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Copyright(C),2019-2020,CarryWLTao互联网工作室
 * FileName:BaseExceptionHandler
 * Author:  Administrator
 * Date:    2020-06-19 11:12
 * Description: 异常处理
 * History:
 * <author>     <time>      <version>       <desc>
 * 作者姓名     修改时间       版本号          描述
 */
@RestControllerAdvice//增强 hold on
public class BaseExceptionHandler {
    @ExceptionHandler(value = Exception.class)//异常处理
    public Result exception(Exception e){
        return new Result(false, StatusCode.ERROR,e.getMessage());
    }
}
